home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 2.00 Begin Form DataForm HelpContextID = 73 BackColor = &H00C0C0C0& Caption = "Form Wizard" ClientHeight = 4950 ClientLeft = 765 ClientTop = 1485 ClientWidth = 8010 Height = 5355 Icon = DATAFORM.FRX:0000 Left = 705 LinkTopic = "Form1" ScaleHeight = 4950 ScaleWidth = 8010 Top = 1140 Width = 8130 Begin VideoSoftIndexTab VSIndexTab1 Align = 1 'Align Top BackSheets = 0 'None BackTabColor = &H00FF0000& Caption = "Data Control|Fields|Form" CaptionStyle = 1 'Raised ConvInfo = DATAFORM.FRX:0302 FontBold = 0 'False FontItalic = 0 'False FontName = "MS Sans Serif" FontSize = 13.5 FontStrikethru = 0 'False FontUnderline = 0 'False FrontTabColor = &H00C0C0C0& Height = 4995 Left = 0 Position = 0 'Top Style = 5 'Chamfered 3D TabIndex = 16 Top = 0 Width = 8010 Begin VideoSoftElastic VSElastic2 HelpContextID = 25 BevelChildren = 4 'Only Graphical ConvInfo = DATAFORM.FRX:030D Height = 4455 IntBkg = &H00C0C0C0& Left = 9870 TabIndex = 20 Top = 495 Width = 7920 Begin VideoSoftElastic VSElastic3 BevelOuter = 0 'None ConvInfo = DATAFORM.FRX:0318 Height = 3105 IntBkg = &H00C0C0C0& Left = 2760 TabIndex = 26 Top = 300 Width = 1110 Begin SSCommand BtnAdd HelpContextID = 29 AutoSize = 2 'Adjust Button Size To Picture Caption = "&Add" Font3D = 2 'Raised w/heavy shading Height = 555 Left = 60 Picture = DATAFORM.FRX:0323 TabIndex = 30 Tag = "Add selected field(s) to the form" Top = 240 Width = 915 Begin SSCommand BtnRemove HelpContextID = 28 AutoSize = 2 'Adjust Button Size To Picture Caption = "&Remove" Font3D = 2 'Raised w/heavy shading Height = 555 Left = 60 Picture = DATAFORM.FRX:0625 TabIndex = 29 Tag = "Remove selected field(s) from the form" Top = 840 Width = 915 Begin SSCommand BtnCancel AutoSize = 2 'Adjust Button Size To Picture Caption = "&Cancel" Font3D = 2 'Raised w/heavy shading Height = 615 Index = 1 Left = 60 Picture = DATAFORM.FRX:0927 TabIndex = 28 Tag = "Cancel building the form" Top = 1500 Width = 915 Begin SSCommand BtnHelp Caption = "&Help" Font3D = 2 'Raised w/heavy shading Height = 615 Index = 1 Left = 60 Picture = DATAFORM.FRX:0C29 TabIndex = 27 Top = 2220 Width = 915 Begin VideoSoftElastic cMsg Align = 2 'Bottom BevelChildren = 3 'No Graphical or Elastics BevelInner = 0 'None BevelOuter = 5 'Fillet BevelOuterWidth = 4 ConvInfo = DATAFORM.FRX:0F2B ForeColor = &H00FF0000& Height = 375 Index = 1 IntBkg = &H00C0C0C0& Left = 0 TabIndex = 25 Top = 4080 Width = 7920 Begin SSFrame Frame3D1 Alignment = 2 'Center Caption = "Select Fields For Form" ForeColor = &H00FF0000& Height = 3795 Left = 90 TabIndex = 23 Top = 90 Width = 2595 Begin ListBox LstFields HelpContextID = 27 BackColor = &H00C0C0C0& Height = 3345 Left = 120 MultiSelect = 2 'Extended TabIndex = 24 Tag = "Select one or more fields to add to the form" Top = 300 Width = 2355 Begin SSFrame FramFldsOnForm Alignment = 2 'Center Caption = "Fields On Form" ForeColor = &H00FF0000& Height = 3765 Left = 3975 TabIndex = 21 Top = 90 Width = 3855 Begin Grid GrdFields HelpContextID = 26 Cols = 4 FixedRows = 0 Height = 3315 Left = 120 Rows = 1 TabIndex = 22 Tag = "Select one or more fields, right click to change attributes" Top = 240 Width = 3555 Begin VideoSoftElastic VSElastic1 HelpContextID = 30 ConvInfo = DATAFORM.FRX:0F36 ForeColor = &H00FF0000& Height = 4455 IntBkg = &H00C0C0C0& Left = 9945 TabIndex = 19 TagSplit = -1 'True TagWidth = 1500 Top = 495 Width = 7920 Begin CommonDialog CMDialog2 DefaultExt = "frm" DialogTitle = "Save Form As" Filter = "VB Forms|*.frm" Left = 660 Top = 2280 Begin SSCommand BtnFindForm HelpContextID = 35 AutoSize = 2 'Adjust Button Size To Picture Font3D = 2 'Raised w/heavy shading Height = 600 Left = 7020 Picture = DATAFORM.FRX:0F41 TabIndex = 5 Tag = "|Press to find the database" Top = 1680 Width = 600 Begin TextBox TxtFrmName HelpContextID = 34 BackColor = &H00C0C0C0& Height = 375 Left = 1920 TabIndex = 4 Tag = "Form File Name|Name to save the form as" Top = 1920 Width = 4995 Begin SSCommand BtnCancel AutoSize = 2 'Adjust Button Size To Picture Caption = "&Cancel" Font3D = 2 'Raised w/heavy shading Height = 615 Index = 2 Left = 3720 Picture = DATAFORM.FRX:1243 TabIndex = 6 Tag = "|Cancel building the form" Top = 2400 Width = 915 Begin SSCommand BtnFinish HelpContextID = 33 AutoSize = 2 'Adjust Button Size To Picture Caption = "&Finish" Enabled = 0 'False Font3D = 2 'Raised w/heavy shading Height = 615 Left = 4620 Picture = DATAFORM.FRX:1545 TabIndex = 7 Tag = "|Generate the form code" Top = 2400 Width = 915 Begin SSCommand BtnFindTmplt HelpContextID = 32 AutoSize = 2 'Adjust Button Size To Picture Font3D = 2 'Raised w/heavy shading Height = 600 Left = 7020 Picture = DATAFORM.FRX:1847 TabIndex = 3 Tag = "|Press to find the database" Top = 1020 Width = 600 Begin TextBox TxtTmpltName HelpContextID = 31 BackColor = &H00C0C0C0& Height = 375 Left = 1920 TabIndex = 2 Tag = "Form Template|Name of the form template" Top = 1260 Width = 4995 Begin SSCommand BtnHelp Caption = "&Help" Font3D = 2 'Raised w/heavy shading Height = 615 Index = 2 Left = 5520 Picture = DATAFORM.FRX:1B49 TabIndex = 8 Top = 2400 Width = 915 Begin VideoSoftElastic cMsg Align = 2 'Bottom BevelChildren = 3 'No Graphical or Elastics BevelInner = 0 'None BevelOuter = 5 'Fillet BevelOuterWidth = 4 ConvInfo = DATAFORM.FRX:1E4B ForeColor = &H00FF0000& Height = 375 Index = 2 IntBkg = &H00C0C0C0& Left = 0 TabIndex = 31 Top = 4080 Width = 7920 Begin TextBox TxtFormCaption HelpContextID = 6 BackColor = &H00C0C0C0& Height = 375 Left = 1935 TabIndex = 0 Tag = "Caption|Caption for the form you are building" Text = "Caption" Top = 240 Width = 3675 Begin TextBox TxtFormName HelpContextID = 5 BackColor = &H00C0C0C0& Height = 375 Left = 1920 TabIndex = 1 Tag = "Name|Name for the form you are building" Text = "Name" Top = 720 Width = 3675 Begin VideoSoftElastic Page HelpContextID = 17 BevelChildren = 3 'No Graphical or Elastics CaptionPos = 7 'Right Center ConvInfo = DATAFORM.FRX:1E56 ForeColor = &H00FF0000& Height = 4455 Index = 0 IntBkg = &H00C0C0C0& Left = 45 PicturePos = 0 'Left Top TabIndex = 17 TagSplit = -1 'True TagWidth = 1500 Top = 495 Width = 7920 Begin SSCommand BtnHelp Caption = "&Help" Font3D = 2 'Raised w/heavy shading Height = 615 Index = 0 Left = 5100 Picture = DATAFORM.FRX:1E61 TabIndex = 15 Top = 2100 Width = 915 Begin CommonDialog CMDialog1 DialogTitle = "Select Database For Data Control" Filter = "Access Databases|*.mdb" Left = 180 Top = 2220 Begin ComboBox LstRecSrce HelpContextID = 19 BackColor = &H00C0C0C0& Height = 300 Left = 1620 Sorted = -1 'True Style = 2 'Dropdown List TabIndex = 13 Tag = "Record Source|Select or enter record source for the data control" Top = 1680 Width = 4395 Begin SSCommand BtnFindDB HelpContextID = 20 AutoSize = 2 'Adjust Button Size To Picture Font3D = 2 'Raised w/heavy shading Height = 600 Left = 5400 Picture = DATAFORM.FRX:2163 TabIndex = 12 Tag = "|Press to find the database" Top = 960 Width = 600 Begin TextBox TxtDBName HelpContextID = 21 BackColor = &H00C0C0C0& Height = 375 Left = 1620 TabIndex = 11 Tag = "Database Name|Name of the database for the data control" Text = "Database Name" Top = 1200 Width = 3675 Begin TextBox TxtName HelpContextID = 22 BackColor = &H00C0C0C0& Height = 375 Left = 1620 TabIndex = 9 Tag = "Name|Name for the data control" Text = "DataName" Top = 240 Width = 3675 Begin TextBox TxtCaption HelpContextID = 23 BackColor = &H00C0C0C0& Height = 375 Left = 1620 TabIndex = 10 Tag = "Caption|Caption for the data control" Text = "Data Caption" Top = 720 Width = 3675 Begin SSCommand BtnCancel AutoSize = 2 'Adjust Button Size To Picture Caption = "&Cancel" Font3D = 2 'Raised w/heavy shading Height = 615 Index = 0 Left = 4200 Picture = DATAFORM.FRX:2465 TabIndex = 14 Tag = "|Cancel building the form" Top = 2100 Width = 915 Begin VideoSoftElastic cMsg Align = 2 'Bottom BevelChildren = 3 'No Graphical or Elastics BevelInner = 0 'None BevelOuter = 5 'Fillet BevelOuterWidth = 4 ConvInfo = DATAFORM.FRX:2767 ForeColor = &H00FF0000& Height = 375 Index = 0 IntBkg = &H00C0C0C0& Left = 0 TabIndex = 18 Top = 4080 Width = 7920 Begin Image ImgTabPic Height = 480 Index = 2 Left = 2280 Picture = DATAFORM.FRX:2772 Top = 3180 Visible = 0 'False Width = 480 Begin Image ImgTabPic Height = 480 Index = 1 Left = 1620 Picture = DATAFORM.FRX:2A74 Top = 3180 Visible = 0 'False Width = 480 Begin Image ImgTabPic Height = 480 Index = 0 Left = 840 Picture = DATAFORM.FRX:2D76 Top = 3180 Visible = 0 'False Width = 480 Option Explicit Dim maxwidth(3) As Long Sub BtnAdd_Click () Dim i As Integer, fld As String ' Add selected feilds to grid For i = 0 To LstFields.ListCount - 1 If LstFields.Selected(i) Then fld = LstFields.List(i) GrdFields.AddItem fld & Chr$(9) & fld & Chr$(9) & "No" & Chr$(9) & Str$(aiFldSize(i)) If TextWidth(fld) + 150 > maxwidth(0) Then maxwidth(0) = TextWidth(fld) + 150 GrdFields.ColWidth(0) = maxwidth(0) End If If TextWidth(fld) + 150 > maxwidth(1) Then maxwidth(1) = TextWidth(fld) + 150 GrdFields.ColWidth(1) = maxwidth(1) End If End If Next i If GrdFields.Rows > 1 Then GrdFields.FixedRows = 1 Mid(RequiredFieldsComplete, 2) = "Y" Call SetFinishBtn End If End Sub Sub BtnAdd_GotFocus () cMsg(1).Caption = BtnAdd.Tag End Sub Sub BtnAdd_LostFocus () cMsg(1).Caption = "" End Sub Sub BtnCancel_Click (Index As Integer) EndItNow End Sub Sub BtnCancel_GotFocus (Index As Integer) SetStatusBar BtnCancel(Index) End Sub Sub BtnCancel_LostFocus (Index As Integer) ClearStatusBar End Sub Sub BtnFindDB_Click () CMDialog1.Flags = OFN_FILEMUSTEXIST CMDialog1.Action = 1 If CMDialog1.Filename <> "" Then TxtDBName = CMDialog1.Filename GetTableNames End If End Sub Sub BtnFindDB_GotFocus () SetStatusBar BtnFindDB End Sub Sub BtnFindDB_LostFocus () ClearStatusBar End Sub Sub BtnFindForm_Click () CMDialog2.DialogTitle = "Save Form As" CMDialog2.Filename = TxtName & ".Frm" CMDialog2.Flags = OFN_OVERWRITEPROMPT + OFN_PATHMUSTEXIST CMDialog2.Action = 2 If CMDialog2.Filename <> "" Then TxtFrmName.Text = CMDialog2.Filename Mid(RequiredFieldsComplete, 4) = "Y" Call SetFinishBtn End If End Sub Sub BtnFindForm_GotFocus () SetStatusBar BtnFindForm End Sub Sub BtnFindForm_LostFocus () ClearStatusBar End Sub Sub BtnFindTmplt_Click () CMDialog2.DialogTitle = "Select Form Template" CMDialog2.Filename = "" CMDialog2.Flags = OFN_FILEMUSTEXIST CMDialog2.Action = 1 If CMDialog2.Filename <> "" Then TxtTmpltName = CMDialog2.Filename Mid(RequiredFieldsComplete, 3) = "Y" Call SetFinishBtn End If End Sub Sub BtnFindTmplt_GotFocus () SetStatusBar BtnFindTmplt End Sub Sub BtnFindTmplt_LostFocus () ClearStatusBar End Sub Sub BtnFinish_Click () Dim msg As String, Char As String On Error GoTo GenerateErr mousepointer = HOURGLASS ' Verify that file names are correct stemplate = TxtTmpltName.Text If Right$(UCase$(TxtFrmName.Text), 4) <> ".FRM" Then TxtFrmName.Text = TxtFrmName.Text & ".FRM" End If sForm = TxtFrmName.Text If stemplate = "" Then Beep mousepointer = DEFAULT MsgBox "You must specify a form template or use the file drawer button to locate a form template.", 0 + 48 + 0 + 0, "Form Template Error" TxtTmpltName.SetFocus Exit Sub End If If Dir$(stemplate) = "" Then Beep mousepointer = DEFAULT MsgBox "The form template you have specified does not exist! Use the file drawer button to locate a form template.", 0 + 48 + 0 + 0, "Form Template Error" TxtTmpltName.SetFocus Exit Sub End If If sForm = "" Then Beep mousepointer = DEFAULT MsgBox "You must specify a form name or use the file drawer button to locate a form.", 0 + 48 + 0 + 0, "Form Save Error" TxtFrmName.SetFocus Exit Sub End If If sForm = stemplate Then Beep mousepointer = DEFAULT MsgBox "You cannot use the template as the output form.", 0 + 48 + 0 + 0, "Form Save Error" TxtFrmName.SetFocus Exit Sub End If On Error GoTo erropeningtemplate Open stemplate For Input Access Read Lock Write As #1 On Error GoTo erropeningform Open sForm For Output Access Write Lock Read Write As #2 On Error GoTo GenerateErr indent = 0 Do While Not EOF(1) sFormLine = "" Do Char = Input$(1, #1) sFormLine = sFormLine + Char Loop While Char <> Chr$(10) sFormLine = Left$(sFormLine, Len(sFormLine) - 2) Select Case True Case InStr(1, sFormLine, "Begin Form", 1) <> 0 ' Beginning of form Print #2, "Begin Form " & DataForm.TxtFormName.Text indent = 3 Case InStr(1, sFormLine, "Caption", 1) <> 0 ' Form Caption line Print #2, Spc(indent); "Caption = " & Chr$(34) & DataForm.TxtFormCaption.Text & Chr$(34) Case InStr(1, sFormLine, "Begin ", 1) <> 0 ' Beginning of control Select Case True Case InStr(1, sFormLine, " Lbl1", 1) <> 0 ' Beginning of label 1 Call SaveLabel1 Case InStr(1, sFormLine, " Lbl2", 1) <> 0 ' Beginning of label 2 Call SaveLabel2 Case InStr(1, sFormLine, " Fld1", 1) <> 0 ' Beginning of field 1 Call SaveField1 Case InStr(1, sFormLine, " Fld2", 1) <> 0 ' Beginning of field 2 Call SaveField2 Case InStr(1, sFormLine, " Data", 1) <> 0 ' Beginning of data control Call SaveDataCtrl Case Else ' Beginning of other control Call SaveControl End Select Case InStr(1, sFormLine, "End", 1) <> 0 ' End of form If Len(sFormLine) < InStr(1, sFormLine, "End", 1) + 4 Then Call GotEndOfForm Else Print #2, Spc(indent); sFormLine ' Output any unrecognized lines as is End If Case Else Print #2, Spc(indent); sFormLine ' Output any unrecognized lines as is End Select Loop Close #1 Close #2 msg = "Form " & sForm & " generated." Beep mousepointer = DEFAULT MsgBox msg, MB_ICONINFORMATION, "Form Wizard Generation" db.Close ' Close the database MainForm.Show MODELESS Unload DataForm Exit Sub GenerateErr: erraction = RB_ErrorHandler("GenForm", "BtnFinish_Click") Select Case erraction Case 1 Resume 0 ' Retry option selected Case 2 Resume Next ' Ignore option selected End Select On Error Resume Next Close #1, #2 On Error GoTo GenerateErr Exit Sub erropeningtemplate: Beep mousepointer = DEFAULT msg = "A " & Error & " error has occurred opening the template file! Please correct and retry the function" MsgBox msg, 0 + 48 + 0 + 0, "Form Template Error" TxtTmpltName.SetFocus Close #1, #2 On Error GoTo GenerateErr Exit Sub erropeningform: Beep mousepointer = DEFAULT msg = "A " & Error & " error has occurred opening the output form file! Please correct and retry the function" MsgBox msg, 0 + 48 + 0 + 0, "Form Output Error" TxtTmpltName.SetFocus Exit Sub End Sub Sub BtnHelp_Click (Index As Integer) SendKeys "{F1}" End Sub Sub BtnHelp_GotFocus (Index As Integer) SetStatusBar BtnCancel(Index) End Sub Sub BtnHelp_LostFocus (Index As Integer) ClearStatusBar End Sub Sub BtnRemove_Click () On Error GoTo removeerr Dim i As Integer, i2 As Integer ' Remove any selected rows except the last one For i = GrdFields.Rows - 2 To 0 Step -1 GrdFields.Row = i GrdFields.Col = 1 If GrdFields.CellSelected Then GrdFields.RemoveItem i End If Next i ' Check if last row is deleted and handle special to prevent error ' caused by selection defaulting to the entire table when the last ' row is removed i = GrdFields.Rows - 1 GrdFields.Row = i GrdFields.Col = 1 If GrdFields.CellSelected Then GrdFields.FixedRows = 0 GrdFields.RemoveItem i End If GrdFields.Refresh If GrdFields.Rows > 1 Then GrdFields.FixedRows = 1 Exit Sub removeerr: erraction = RB_ErrorHandler("FieldFrm", "BtnRemove_Click") Select Case erraction Case 1 Resume 0 ' Retry option selected Case 2 Resume Next ' Ignore option selected End Select End Sub Sub BtnRemove_GotFocus () cMsg(1).Caption = BtnRemove.Tag End Sub Sub BtnRemove_LostFocus () cMsg(1).Caption = "" End Sub Sub ClearStatusBar () cMsg(VsIndexTab1.CurrTab).Caption = "" End Sub Sub FldGotFocus (PControl As Control) PControl.BackColor = BLUE PControl.ForeColor = WHITE If TypeOf PControl Is TextBox Then PControl.SelStart = 0 PControl.SelLength = 1000 End If If InStr(PControl.Tag, "|") = 0 Then cMsg(VsIndexTab1.CurrTab).Caption = PControl.Tag Else cMsg(VsIndexTab1.CurrTab).Caption = Mid$(PControl.Tag, InStr(PControl.Tag, "|") + 1) End If End Sub Sub FldLostFocus (PControl As Control) PControl.BackColor = RB_GRAY PControl.ForeColor = BLACK cMsg(VsIndexTab1.CurrTab).Caption = "" End Sub Sub Form_Load () On Error GoTo loaderr ' Set up grid headings GrdFields.Row = 0 GrdFields.Col = 0 GrdFields.Text = "Field" GrdFields.ColWidth(0) = TextWidth(" Field ") maxwidth(0) = GrdFields.ColWidth(0) GrdFields.Col = 1 GrdFields.Text = "Label" GrdFields.ColWidth(1) = TextWidth(" Label ") maxwidth(1) = GrdFields.ColWidth(1) GrdFields.Col = 2 GrdFields.Text = "Same" & Chr$(13) & "Line" GrdFields.ColWidth(2) = TextWidth(" Same ") maxwidth(2) = GrdFields.ColWidth(2) GrdFields.Col = 3 GrdFields.Text = "Size" GrdFields.ColWidth(3) = TextWidth(" Size ") GrdFields.RowHeight(0) = 2 * TextHeight("Same") VsIndexTab1.TabEnabled(1) = False VsIndexTab1.TabPicture(0) = ImgTabPic(0) VsIndexTab1.TabPicture(1) = ImgTabPic(1) VsIndexTab1.TabPicture(2) = ImgTabPic(2) Exit Sub loaderr: erraction = RB_ErrorHandler("FieldFrm", "Form_Load") Select Case erraction Case 1 Resume 0 ' Retry option selected Case 2 Resume Next ' Ignore option selected End Select End Sub Sub Form_Resize () If DataForm.WindowState <> 1 Then ' If not minimized If VsIndexTab1.CurrTab = 1 Then ' If field tab is current FramFldsOnForm.Width = DataForm.Width - FramFldsOnForm.Left - 250 GrdFields.Width = FramFldsOnForm.Width - GrdFields.Left - 150 End If End If End Sub Sub GetTableNames () ' Get names of tables in selected database Dim sstables As snapshot, msg As String On Error GoTo GetTablesErr mousepointer = HOURGLASS If TxtDBName.Text = "" Then Exit Sub On Error GoTo OpenDBErr If Dir$(TxtDBName.Text) = "" Then Beep MsgBox "The database name you have specified does not exist! Use the file drawer button to locate a database.", 0 + 48 + 0 + 0, "Database Selection Error" TxtDBName.SetFocus mousepointer = DEFAULT Exit Sub End If LstRecSrce.Clear Set db = OpenDatabase(TxtDBName.Text) On Error GoTo GetTablesErr Set sstables = db.ListTables() Do While Not sstables.EOF If sstables!Attributes And DB_SYSTEMOBJECT Then Else LstRecSrce.AddItem sstables!Name End If sstables.MoveNext Loop sstables.Close LstRecSrce.ListIndex = 0 Mid(RequiredFieldsComplete, 1, 1) = "Y" Call SetFinishBtn mousepointer = DEFAULT Exit Sub OpenDBErr: Beep mousepointer = DEFAULT msg = "A " & Error & " error has occurred opening the database! Please correct and retry the function" MsgBox msg, 0 + 48 + 0 + 0, "Database Specification Error" TxtDBName.SetFocus On Error GoTo GetTablesErr mousepointer = DEFAULT Exit Sub GetTablesErr: mousepointer = DEFAULT erraction = RB_ErrorHandler("DataSpec", "GetTableNames") Select Case erraction Case 1 Resume 0 ' Retry option selected Case 2 Resume Next ' Ignore option selected End Select End Sub Sub GrdFields_GotFocus () cMsg(1).Caption = GrdFields.Tag End Sub Sub GrdFields_LostFocus () cMsg(1).Caption = "" End Sub Sub GrdFields_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single) Dim i As Integer, istart As Integer, iend As Integer If Button = RIGHT_BUTTON Then istart = GrdFields.SelStartRow If istart = 0 Then istart = 1 iend = GrdFields.SelEndRow For i = istart To iend GrdFields.Row = i GrdFields.Col = 0 ChngFld.LblField.Caption = GrdFields.Text GrdFields.Col = 1 ChngFld.TxtLabel = GrdFields.Text GrdFields.Col = 2 If GrdFields.Text = "Yes" Then ChngFld.ChkSameLine.Value = True Else ChngFld.ChkSameLine.Value = False End If ChngFld.LblRow.Caption = Str$(i) ChngFld.Show MODAL Next i End If End Sub Sub LstFields_GotFocus () cMsg(1).Caption = LstFields.Tag End Sub Sub LstFields_LostFocus () cMsg(1).Caption = "" End Sub Sub LstRecSrce_Click () Dim ds As dynaset, ssfields As snapshot Dim iNumFlds As Integer On Error GoTo LoadListErr ' Load list of fields in record source mousepointer = HOURGLASS Set ds = db.CreateDynaset(LstRecSrce.Text) Set ssfields = ds.ListFields() ds.Close LstFields.Clear ReDim aiFldSize(1) iNumFlds = -1 Do While Not ssfields.EOF LstFields.AddItem ssfields!Name iNumFlds = iNumFlds + 1 ReDim Preserve aiFldSize(iNumFlds) aiFldSize(iNumFlds) = ssfields!Size ssfields.MoveNext Loop ssfields.Close NewRecordSource = False ' Clear the grid of fields GrdFields.Rows = 1 VsIndexTab1.TabEnabled(1) = True ' Enable the Fields tab mousepointer = DEFAULT Exit Sub LoadListErr: erraction = RB_ErrorHandler("FieldFrm", "Form_Activate") Select Case erraction Case 1 Resume 0 ' Retry option selected Case 2 Resume Next ' Ignore option selected End Select End Sub Sub LstRecSrce_GotFocus () FldGotFocus LstRecSrce End Sub Sub LstRecSrce_LostFocus () FldLostFocus LstRecSrce End Sub Sub SetFinishBtn () ' Check if Finish Button should be enabled If RequiredFieldsComplete = "YYYY" Then BtnFinish.Enabled = True Else BtnFinish.Enabled = False End If End Sub Sub SetStatusBar (PControl As Control) If InStr(PControl.Tag, "|") = 0 Then cMsg(VsIndexTab1.CurrTab).Caption = PControl.Tag Else cMsg(VsIndexTab1.CurrTab).Caption = Mid$(PControl.Tag, InStr(PControl.Tag, "|") + 1) End If End Sub Sub TxtCaption_GotFocus () FldGotFocus TxtCaption End Sub Sub TxtCaption_LostFocus () FldLostFocus TxtCaption End Sub Sub TxtDBName_GotFocus () FldGotFocus TxtDBName End Sub Sub TxtDBName_LostFocus () FldLostFocus TxtDBName If TxtDBName.DataChanged Then GetTableNames End If End Sub Sub TxtFormCaption_GotFocus () FldGotFocus TxtFormCaption End Sub Sub TxtFormCaption_LostFocus () FldLostFocus TxtFormCaption End Sub Sub TxtFormName_GotFocus () FldGotFocus TxtFormName End Sub Sub TxtFormName_LostFocus () FldLostFocus TxtFormName End Sub Sub TxtFrmName_GotFocus () FldGotFocus TxtFrmName End Sub Sub TxtFrmName_LostFocus () FldLostFocus TxtFrmName If TxtFrmName.Text <> "" Then Mid(RequiredFieldsComplete, 4) = "Y" Call SetFinishBtn End If End Sub Sub TxtName_GotFocus () FldGotFocus TxtName End Sub Sub TxtName_LostFocus () FldLostFocus TxtName End Sub Sub TxtTmpltName_GotFocus () FldGotFocus TxtTmpltName End Sub Sub TxtTmpltName_LostFocus () FldLostFocus TxtTmpltName If TxtTmpltName.Text <> "" Then Mid(RequiredFieldsComplete, 3) = "Y" Call SetFinishBtn End If End Sub